/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.hieu.sms.model;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 *
 * @author do_th
 */
@Entity
@Table(name = "clazz")
@NamedQueries({
    @NamedQuery(name = "Clazz.findAll", query = "SELECT c FROM Clazz c"),
    @NamedQuery(name = "Clazz.findById", query = "SELECT c FROM Clazz c WHERE c.id = :id"),
    @NamedQuery(name = "Clazz.findByClazzId", query = "SELECT c FROM Clazz c WHERE c.clazzId = :clazzId"),
    @NamedQuery(name = "Clazz.findByName", query = "SELECT c FROM Clazz c WHERE c.name = :name"),
    @NamedQuery(name = "Clazz.findByDepId", query = "SELECT c FROM Clazz c WHERE c.depId = :depId")})
public class Clazz extends AbstractPersistentEntity {
    private static final long serialVersionUID = 1L;
    @Id
	@Column(name="id",updatable = false)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "ClazzSequence")
	@SequenceGenerator(name = "ClazzSequence", sequenceName = "seq_clazz", allocationSize = 1)
    private Long id;
    @Basic(optional = false)
    @Column(name = "clazz_id")
    private String clazzId;
    @Column(name = "name")
    private String name;
    @Basic(optional = false)
    @Column(name = "dep_id")
    private String depId;

    public Clazz() {
    }

    public Clazz(Long id) {
        this.id = id;
    }

    public Clazz(Long id, String clazzId, String depId) {
        this.id = id;
        this.clazzId = clazzId;
        this.depId = depId;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getClazzId() {
        return clazzId;
    }

    public void setClazzId(String clazzId) {
        this.clazzId = clazzId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDepId() {
        return depId;
    }

    public void setDepId(String depId) {
        this.depId = depId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Clazz)) {
            return false;
        }
        Clazz other = (Clazz) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.hieu.sms.model.Clazz[ id=" + id + " ]";
    }
    
}
